#!/usr/bin/env python3

def str2Float(s):
    f = 0.0
    point = 1
    pointFlags = False

    for c in s:
        if c == '.':
            pointFlags = True
            continue

        if pointFlags:
            point *= 10

        f = f * 10 + ord(c) - 48

    return f / point


def main():
    f = str2Float('0.789789')
    print(type(f), f)

if __name__ == "__main__":
    main()
